Hello,
I'm using 4.33
I'm setting up an XYZ router .
I have the Coordinate system set up as (0,2,1,-1) for wiring convenience.
I lost the Jog button function on K CNC at some point then it returned then I lost it again while I was accessing the init file in K motion to get the axis directions correct.
When I lost the Jog function the first time, I was able to get it back by Closing KCNC and Kmotion and just reopening them again and running the init file.( I think). Now I just open KCNC and still cannot get the Jog buttons to work but I can run a G code program OK.
Is there any problem in having both Kmotion and KCNC open at the same time? I like to go back and forth between the two for diagnostic purposes.
When I run an init file on K CNC, does that override the last program I ran in a K motion thread? What if the init file in KCNC was assigned to run on a thread that was running a run forever program that was previously initiated in Kmotion?
I will be adding a Y2 axis slaved to the Y once I get the main
operation correct. I'm assuming all I have to do to accomplish that is
set the Y2 (ch3) axis as a slave to Y (ch2) and the coordinate system
assignments stay the same. Is that correct?
Below is my init file.
Any thoughts?
AZ
#include "KMotionDef.h"
//Init3Destiny_A gaint set x reverse
main()
{
int BitA,Change1=0,Change2=0, DiffX2;
int PosNoWrap, NewPos, Pos=0, wraps;
double Factor=0;
//Setting Fet outputs
SetBit(152);
SetBit(157);
SetBit(158);
ch0->InputMode=ENCODER_MODE;
ch0->OutputMode=DAC_SERVO_MODE;
ch0->Vel=100000;
ch0->Accel=1e+006;
ch0->Jerk=1e+01;
ch0->P=0.17;
ch0->I=0;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=10;
ch0->MaxErr=50000;
ch0->MaxOutput=2000;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=0;
ch0->InputChan1=0;
ch0->OutputChan0=0;
ch0->OutputChan1=0;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x100;
ch0->LimitSwitchNegBit=0;
ch0->LimitSwitchPosBit=0;
ch0->SoftLimitPos=1e+009;
ch0->SoftLimitNeg=-1e+009;
ch0->InputGain0=-1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->BacklashMode=BACKLASH_OFF;
ch0->BacklashAmount=0;
ch0->BacklashRate=0;
ch0->invDistPerCycle=0.00025;
ch0->Lead=0;
ch0->MaxFollowingError=50000;
ch0->StepperAmplitude=100;
ch0->iir[0].B0=1.000000;
ch0->iir[0].B1=0.000000;
ch0->iir[0].B2=0.000000;
ch0->iir[0].A1=0.000000;
ch0->iir[0].A2=0.000000;
ch0->iir[1].B0=1.000000;
ch0->iir[1].B1=0.000000;
ch0->iir[1].B2=0.000000;
ch0->iir[1].A1=0.000000;
ch0->iir[1].A2=0.000000;
ch0->iir[2].B0=0.002945;
ch0->iir[2].B1=0.005890;
ch0->iir[2].B2=0.002945;
ch0->iir[2].A1=1.832150;
ch0->iir[2].A2=-0.843926;
ch1->InputMode=ENCODER_MODE;
ch1->OutputMode=DAC_SERVO_MODE;
ch1->Vel=100000;
ch1->Accel=1e+006;
ch1->Jerk=1e+01;
ch1->P=0.17;
ch1->I=0;
ch1->D=0;
ch1->FFAccel=0;
ch1->FFVel=0;
ch1->MaxI=10;
ch1->MaxErr=20000;
ch1->MaxOutput=2000;
ch1->DeadBandGain=1;
ch1->DeadBandRange=0;
ch1->InputChan0=1;
ch1->InputChan1=1;
ch1->OutputChan0=1;
ch1->OutputChan1=1;
ch1->MasterAxis=-1;
ch1->LimitSwitchOptions=0x100;
ch1->LimitSwitchNegBit=0;
ch1->LimitSwitchPosBit=0;
ch1->SoftLimitPos=1e+009;
ch1->SoftLimitNeg=-1e+009;
ch1->InputGain0=1;
ch1->InputGain1=1;
ch1->InputOffset0=0;
ch1->InputOffset1=0;
ch1->OutputGain=-1;
ch1->OutputOffset=0;
ch1->SlaveGain=1;
ch1->BacklashMode=BACKLASH_OFF;
ch1->BacklashAmount=0;
ch1->BacklashRate=0;
ch1->invDistPerCycle=0.00025;
ch1->Lead=0;
ch1->MaxFollowingError=50000;
ch1->StepperAmplitude=100;
ch1->iir[0].B0=1.000000;
ch1->iir[0].B1=0.000000;
ch1->iir[0].B2=0.000000;
ch1->iir[0].A1=0.000000;
ch1->iir[0].A2=0.000000;
ch1->iir[1].B0=1.000000;
ch1->iir[1].B1=0.000000;
ch1->iir[1].B2=0.000000;
ch1->iir[1].A1=0.000000;
ch1->iir[1].A2=0.000000;
ch1->iir[2].B0=0.002945;
ch1->iir[2].B1=0.005890;
ch1->iir[2].B2=0.002945;
ch1->iir[2].A1=1.832150;
ch1->iir[2].A2=-0.843926;
ch2->InputMode=ENCODER_MODE;
ch2->OutputMode=DAC_SERVO_MODE;
ch2->Vel=100000;
ch2->Accel=1e+006;
ch2->Jerk=1e+01;
ch2->P=0.17;
ch2->I=0.00;
ch2->D=0;
ch2->FFAccel=0;
ch2->FFVel=0;
ch2->MaxI=10;
ch2->MaxErr=50000;
ch2->MaxOutput=2000;
ch2->DeadBandGain=1;
ch2->DeadBandRange=0;
ch2->InputChan0=2;
ch2->InputChan1=2;
ch2->OutputChan0=2;
ch2->OutputChan1=2;
ch2->MasterAxis=-1;
ch2->LimitSwitchOptions=0x100;
ch2->LimitSwitchNegBit=0;
ch2->LimitSwitchPosBit=0;
ch2->SoftLimitPos=1e+009;
ch2->SoftLimitNeg=-1e+009;
ch2->InputGain0=1;
ch2->InputGain1=1;
ch2->InputOffset0=0;
ch2->InputOffset1=0;
ch2->OutputGain=-1;
ch2->OutputOffset=0;
ch2->SlaveGain=1;
ch2->BacklashMode=BACKLASH_OFF;
ch2->BacklashAmount=0;
ch2->BacklashRate=0;
ch2->invDistPerCycle=0.00025;
ch2->Lead=0;
ch2->MaxFollowingError=50000;
ch2->StepperAmplitude=100;
ch2->iir[0].B0=1.000000;
ch2->iir[0].B1=0.000000;
ch2->iir[0].B2=0.000000;
ch2->iir[0].A1=0.000000;
ch2->iir[0].A2=0.000000;
ch2->iir[1].B0=1.000000;
ch2->iir[1].B1=0.000000;
ch2->iir[1].B2=0.000000;
ch2->iir[1].A1=0.000000;
ch2->iir[1].A2=0.000000;
ch2->iir[2].B0=0.002945;
ch2->iir[2].B1=0.005890;
ch2->iir[2].B2=0.002945;
ch2->iir[2].A1=1.832150;
ch2->iir[2].A2=-0.843926;
DisableAxis(0);
DisableAxis(1);
DisableAxis(2);
DisableAxis(0); // disable the axis
Zero(0); // Zero the position
DisableAxis(1); // disable the axis
Zero(1); // Zero the position
DisableAxis(2); // disable the axis
Zero(2); // Zero the position
EnableAxisDest(0,0);
EnableAxisDest(1,0);
EnableAxisDest(2,0);
EnableAxis(0);
EnableAxis(1);
EnableAxis(2);
DefineCoordSystem(0,2,1,-1);
// Set up I/O board
// Board address is 0,
// 16 Outputs are mapped to Virtual IO 48-63 (VirtualBits)
// 32 Inputs are mapped to Virtual IO 1024-1055 (VirtualBits[0])
InitAux();
AddKonnect(0,&VirtualBits,VirtualBitsEx);
}